NOTE: PROCEDURE PRINTTO used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

4    
5    * Must run the code 4 times for 4 different specifications in table 8. Need to update the
5  ! selections below;
6    * ;
7    
8    DM "log; clear; ";
9    DM 'odsresults; clear';
10   
11   %global projectrootdirectory;
12   %let projectrootdirectory=C:/Users/hpham13/Projects/mf_activism/empirical;
13   
14   *Creates your local Libraries;
15   libname rawdata "&projectrootdirectory./0_input/original";
NOTE: Libref RAWDATA was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Projects\mf_activism\empirical\0_input\original
16   libname save    "&projectrootdirectory./1_code/final_package_acceptance";
NOTE: Libref SAVE was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: 
      C:\Users\hpham13\Projects\mf_activism\empirical\1_code\final_package_acceptance
17   libname data    "C:/Users/hpham13/Projects/mutualfund/empirical/0_inputs/mfdb/Data/Original"
17 ! ;
NOTE: Libref DATA was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Projects\mutualfund\empirical\0_inputs\mfdb\Data\Original
18   
19   %global datadirectory;
20   %let datadirectory=C:/Users/hpham13/Data;
21   
22   /* Define the local library */
23   libname data "C:/Users/hpham13/Projects/mutualfund/empirical/0_inputs/mfdb/Data/Original";
NOTE: Libref DATA was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Projects\mutualfund\empirical\0_inputs\mfdb\Data\Original
24   libname lnk "&datadirectory./Linking_tables/";
NOTE: Libref LNK was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables
25   libname ceo "&datadirectory./ceo/";
NOTE: Libref CEO was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\ceo
26   libname activism "&datadirectory./activism/" ;
NOTE: Libref ACTIVISM was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\activism
27   libname comp "&datadirectory./compustat/fundq/";
NOTE: Libref COMP was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\compustat\fundq
28   libname crsp "&datadirectory./crsp/";
NOTE: Libref CRSP was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\crsp
29   libname tr "&datadirectory./ThomsonReuters/s12";
NOTE: Libref TR was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\ThomsonReuters\s12
30   libname lnk "&datadirectory./Linking_tables";
NOTE: Libref LNK was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables
31   libname mfl "&datadirectory./Linking_tables/mflink2_20230828";
NOTE: Libref MFL was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables\mflink2_20230828
32   
33   * include some macros;
34   %include "&datadirectory./utils/do_over.sas";
341  %include "&datadirectory./utils/ff48.sas";
413  %include "&datadirectory./utils/ff49.sas";
486  %include "&datadirectory./utils/ff12.sas";
525  %include "&datadirectory./utils/winsorize.sas";
613   %include "&datadirectory./utils/lags.sas";
792   
793   
794   
795   /* ******************************************************************************** */
796   /* PART 1:  Compute MF holdings "Adjusted Shares Held" from S12 and CRSP     ****** */
797   /* ******************************************************************************** */
798   /* Step 1.1. Specifying Options */
799   %let begdate = 01MAR1995;
800   %let enddate = 31DEC2021;
801   
802   /* Step 1.2. Get CRSP Prices, Returns, and Adjustment Factors from MSF Dataset */
803   /* and Since Thomson S12 is Quarterly (FDATE & RDATE), we align CRSP month-end dates */
804   data Price;
805       format QDATE date9. ;
806       set crsp.msf (keep=permno date cfacpr cfacshr shrout prc ret);
NOTE: Data file CRSP.MSF.DATA is in a format that is native to another host, or the file 
      encoding does not match the session encoding. Cross Environment Data Access will be used, 
      which might require additional CPU resources and might reduce performance.
807       by permno date;
808       where date between "&begdate"d and "&enddate"d;
809       QDATE = INTNX('QTR',date,0,'E');
810       DATE = INTNX('MONTH',date,0,'E');
811       TSO=shrout*cfacshr*1000;
812       P  = abs(prc)/cfacpr;
813       P_1= lag(P); if first.permno then P_1=.;
814       ME = P*TSO/1000000;
815       label TSO = "Total Shares Outstanding, Adjusted";
816       label P = "Price at t Period End, Adjusted";
817       label P_1 = "Price at (t-1), Adjusted";
818       label ME = "Market Capitalization, x$1m";
819       if TSO>0; format TSO comma12.0 ret percentn8.2 prc: dollar12.3;
820       drop /*prc*/ cfacpr shrout;
821   run;

NOTE: Division by zero detected at line 812 column 18.
QDATE=31DEC2011 PERMNO=13030 DATE=20111031 PRC=$17.330 RET=C SHROUT=200 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164928
NOTE: Division by zero detected at line 812 column 18.
QDATE=31DEC2011 PERMNO=13030 DATE=20111130 PRC=$17.360 RET=0.17% SHROUT=300 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164929
NOTE: Division by zero detected at line 812 column 18.
QDATE=31DEC2011 PERMNO=13030 DATE=20111231 PRC=$12.160 RET=-29.95% SHROUT=800 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164930
NOTE: Division by zero detected at line 812 column 18.
QDATE=31MAR2012 PERMNO=13030 DATE=20120131 PRC=$6.830 RET=-43.83% SHROUT=2500 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164931
NOTE: Division by zero detected at line 812 column 18.
QDATE=31MAR2012 PERMNO=13030 DATE=20120229 PRC=$5.490 RET=-19.62% SHROUT=19098 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164932
NOTE: Division by zero detected at line 812 column 18.
QDATE=30SEP2004 PERMNO=90298 DATE=20040731 PRC=$11.450 RET=C SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059434
NOTE: Division by zero detected at line 812 column 18.
QDATE=30SEP2004 PERMNO=90298 DATE=20040831 PRC=$11.720 RET=2.36% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059435
NOTE: Division by zero detected at line 812 column 18.
QDATE=30SEP2004 PERMNO=90298 DATE=20040930 PRC=$15.990 RET=36.43% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059436
NOTE: Division by zero detected at line 812 column 18.
QDATE=31DEC2004 PERMNO=90298 DATE=20041031 PRC=$17.100 RET=6.94% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059437
NOTE: Division by zero detected at line 812 column 18.
QDATE=31DEC2004 PERMNO=90298 DATE=20041130 PRC=$22.550 RET=31.87% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059438
NOTE: Division by zero detected at line 812 column 18.
QDATE=31DEC2004 PERMNO=90298 DATE=20041231 PRC=$16.250 RET=-27.01% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059439
NOTE: Division by zero detected at line 812 column 18.
QDATE=31MAR2005 PERMNO=90298 DATE=20050131 PRC=$16.890 RET=3.94% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059440
NOTE: Division by zero detected at line 812 column 18.
QDATE=31MAR2005 PERMNO=90298 DATE=20050228 PRC=$21.670 RET=28.30% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059441
NOTE: Division by zero detected at line 812 column 18.
QDATE=31MAR2005 PERMNO=90298 DATE=20050331 PRC=$18.550 RET=-13.43% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059442
NOTE: Division by zero detected at line 812 column 18.
QDATE=30JUN2005 PERMNO=90298 DATE=20050430 PRC=$15.600 RET=-15.90% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059443
NOTE: Division by zero detected at line 812 column 18.
QDATE=30JUN2005 PERMNO=90298 DATE=20050531 PRC=$15.940 RET=2.18% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059444
NOTE: Division by zero detected at line 812 column 18.
QDATE=30JUN2005 PERMNO=90298 DATE=20050630 PRC=$15.870 RET=-0.44% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059445
NOTE: Division by zero detected at line 812 column 18.
QDATE=30SEP2005 PERMNO=90298 DATE=20050731 PRC=$15.370 RET=-0.25% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=0 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059446
NOTE: Division by zero detected at line 812 column 18.
QDATE=30SEP2005 PERMNO=90298 DATE=20050731 PRC=$15.370 RET=-0.25% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=0 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059447
NOTE: Division by zero detected at line 812 column 18.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
QDATE=30SEP2005 PERMNO=90298 DATE=20050831 PRC=$15.410 RET=0.26% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059448
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      16861 at 811:15   64195 at 812:10   64195 at 812:18   64851 at 814:11   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      656 at 812:18   
NOTE: There were 2373587 observations read from the data set CRSP.MSF.
      WHERE (date>='01MAR1995'D and date<='31DEC2021'D);
NOTE: The data set WORK.PRICE has 2340645 observations and 10 variables.
NOTE: DATA statement used (Total process time):
      real time           10.89 seconds
      cpu time            3.28 seconds
      

822   
823   /* Keep Last Monthly Observation for Each quarter */
824   data Price;
825       set Price;
826       by permno qdate date;
827       if last.qdate;
828   run;

NOTE: There were 2340645 observations read from the data set WORK.PRICE.
NOTE: The data set WORK.PRICE has 788968 observations and 10 variables.
NOTE: DATA statement used (Total process time):
      real time           0.17 seconds
      cpu time            0.14 seconds
      

829   
830   /* Step 1.3. Get report and vintage dates from Thomson-Reuters Mutual Fund Holdings     */
831   /* Exclude Non-Equity Funds from Holdings data that is reported as of Fiscal Quarter End */
832   /* First, Keep First Vintage with Holdings Data for Each RDATE-FUNDNO */
833   proc sql;
834       create table First_Vint
835       as select distinct intnx("month",rdate,0,"E") as rdate format date9., fdate, fundno
836       from tr.s12type1
837       where ("&begdate"d <= rdate <="&enddate"d and ioc not in (1,5,6,7))
838       group by fundno, intnx("month",rdate,0,"E")
839       having fdate=min(fdate) and max(rdate)=rdate
840       order by fundno, rdate desc;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FIRST_VINT created, with 1552309 rows and 3 columns.

841   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.78 seconds
      cpu time            2.14 seconds
      

842   
843   /* Until 2003, funds were only required to disclose their holdings semi-annually        */
844   /* Approximately 60% of funds additionally report quarterly holdings                    */
845   /* Use 6-Months as cut-off for portfolio holding period if the gap btw rdates is large  */
846   data First_Vint; set First_Vint;
847       by fundno descending rdate; format nrdate date9.;
848       nrdate = lag(rdate); if first.fundno then nrdate = intnx("month",rdate,6,"E");
849       nrdate = min(nrdate,intnx("month",rdate,6,"E"));
850   run;

NOTE: There were 1552309 observations read from the data set WORK.FIRST_VINT.
NOTE: The data set WORK.FIRST_VINT has 1552309 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.44 seconds
      cpu time            0.45 seconds
      

851   proc sort data=First_Vint nodupkey; by fundno fdate; run;

NOTE: There were 1552309 observations read from the data set WORK.FIRST_VINT.
NOTE: 14 observations with duplicate key values were deleted.
NOTE: The data set WORK.FIRST_VINT has 1552295 observations and 4 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.27 seconds
      cpu time            0.34 seconds
      

852   
853   /* Step 1.4. Add WFICN portfolio identifiers from MFLINKS */
854   proc sql;
855       create table First_Vint
856       as select b.wficn, a.*
857       from First_Vint as a, mfl.mflink2 as b
858       where a.fundno=b.fundno and a.fdate=b.fdate and not missing(b.wficn);
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.FIRST_VINT created, with 419694 rows and 5 columns.

859   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.65 seconds
      cpu time            0.39 seconds
      

860   proc sort data=First_Vint nodupkey; by wficn rdate; run;

NOTE: There were 419694 observations read from the data set WORK.FIRST_VINT.
NOTE: 122 observations with duplicate key values were deleted.
NOTE: The data set WORK.FIRST_VINT has 419572 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.10 seconds
      cpu time            0.17 seconds
      

861   
862   /* Add Total Number of S12 Filers During Each Quarter (NumInst) */
863   proc sql undo_policy=none;
864       create table First_Vint
865       as select distinct *, count(fundno) as NumInst
866       from First_Vint
867       group by rdate
868       order by fdate, fundno;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FIRST_VINT created, with 419572 rows and 6 columns.

869   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.26 seconds
      cpu time            0.39 seconds
      

870   
871   
872   /* Step 1.5. Extract Holdings data by Merging TR-MF S12type1 and S12type3 Sets  */
873   proc sql;
874       /* quarterly data */
875       create view Holdings
876       as select a.rdate,a.nrdate,a.fdate,a.wficn,a.fundno,a.NumInst,b.cusip,b.shares
877       from First_Vint as a, tr.s12type3 as b
878       where a.fdate=b.fdate and a.fundno=b.fundno;
NOTE: SQL view WORK.HOLDINGS has been defined.
879   
880       /* monthly data */
881       create view Holdings1
882       as select a.rdate,a.nrdate,a.fdate,a.wficn,a.fundno,a.NumInst,b.permno,a.shares
883       from Holdings as a, (select distinct ncusip, permno from data.msenames
884                      where not missing(ncusip)) as b
885       where a.cusip=b.ncusip;
NOTE: SQL view WORK.HOLDINGS1 has been defined.
886   
887       /* quarterly data @ stock level */
888       create table Holdings2
889       as select b.date, a.rdate,a.nrdate,a.wficn,a.fundno,a.permno,a.NumInst,
890           a.shares*b.cfacshr as shares_adj label = "Adjusted Shares Held"
891       from Holdings1 as a, price as b
892       where a.permno=b.permno and a.fdate=b.qdate;
NOTE: Table WORK.HOLDINGS2 created, with 43478321 rows and 8 columns.

893   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           31.84 seconds
      cpu time            30.17 seconds
      

894   
895   /* Sanity Checks for Duplicates */
896   proc sort
897      data=Holdings2
898      out=MF_Holdings nodupkey;
899      by wficn rdate permno;
900   run;

NOTE: There were 43478321 observations read from the data set WORK.HOLDINGS2.
NOTE: 23 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_HOLDINGS has 43478298 observations and 8 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           7.68 seconds
      cpu time            20.42 seconds
      

901   
902   
903   /* ******************************************************************************** */
904   /* Part 2:   Make a List of Domestic all-equity funds using CRSP MFDB   *********** */
905   /* ******************************************************************************** */
906   /* Extract CRSP Mutual Funds Performance and Characteristics */
907   /* Merge fraction of portfolio in equity assets with the objective code data */
908   proc sql;
909   create table Fund_Style
910   as select a.crsp_fundno, a.si_obj_cd, a.wbrger_obj_cd, a.lipper_obj_cd, a.lipper_obj_name,
911             a.lipper_asset_cd, a.policy, a.lipper_class, a.crsp_obj_cd, b.avrcs
912   from crsp.fund_style a left join (select distinct crsp_fundno, sum(per_com)/count(per_com)
912 ! as avrcs
913                                      from data.fund_summary2 group by crsp_fundno) b
914   on a.crsp_fundno=b.crsp_fundno;
NOTE: Table WORK.FUND_STYLE created, with 186445 rows and 10 columns.

915   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           5.38 seconds
      cpu time            0.79 seconds
      

916   
917   /* Step 2.2. Sample Selection, focus on Domestic Equity Mutual Funds */
918   /* for which the holdings data are the most complete and reliable */
919   data Equity_Funds; set Fund_Style;
920   if not missing (Lipper_Class) and lipper_class not in
920 ! ('EIEI','G','LCCE','LCGE','LCVE','MCCE',
921      'MCGE','MCVE','MLCE','MLGE','MLVE','SCCE','SCGE','SCVE') then delete;
922   else if missing(Lipper_Class) then do;
923    if  not missing(si_obj_cd) and si_obj_cd not in ('AGG','GMC','GRI','GRO','ING','SCG') then
923 !  delete;
924    else if missing(si_obj_cd) then do;
925     if not missing (wbrger_obj_cd) and wbrger_obj_cd not in
925 ! ('G','G-I','AGG','GCI','GRI','GRO','LTG',
926        'MCG','SCG') then delete;
927     else if missing(wbrger_obj_cd) then do;
928       if not missing(policy) and policy ne 'CS' then delete;
929        else if not missing(policy) and avrcs<80 then delete;
930   end; end; end;
931   keep crsp_fundno lipper_obj_cd lipper_obj_name crsp_obj_cd;
932   run;

NOTE: There were 186445 observations read from the data set WORK.FUND_STYLE.
NOTE: The data set WORK.EQUITY_FUNDS has 72495 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
      

933   
934   data names; set crsp.fund_names (where=(fund_name ne ''));
935       by crsp_fundno;
936       if last.crsp_fundno;
937       keep crsp_fundno fund_name index_fund_flag;
938   run;

NOTE: There were 599342 observations read from the data set CRSP.FUND_NAMES.
      WHERE fund_name not = ' ';
NOTE: The data set WORK.NAMES has 71033 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.88 seconds
      cpu time            0.17 seconds
      

939   
940   /* identify index and target date funds and drop them from the sample */
941   data funds3; merge Equity_Funds (in=in1) names;
942       by crsp_fundno;
943       if in1;
944   run;

NOTE: There were 72495 observations read from the data set WORK.EQUITY_FUNDS.
NOTE: There were 71033 observations read from the data set WORK.NAMES.
NOTE: The data set WORK.FUNDS3 has 72495 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
      

945   
946   proc sql;
947       create table funds4 (drop=index_fund_flag) as
948       select * from funds3
949       group by crsp_fundno
950       having count(index_fund_flag) = 0;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FUNDS4 created, with 68402 rows and 5 columns.

951   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds
      

952   
953   data funds4; set funds4;
954         format namex $140.;
955         namex = lowcase(fund_name);
956         if max(index(namex,'index'), index(namex,'s&p')) = 0;
957         if max(index(namex,'idx'), index(namex,'dfa'), index(namex,'program')) = 0;
958         if max(indexw(namex,'etf'),index(namex,'exchange traded'),
959               index(namex,'exchange-traded')) = 0;
960         if max(index(namex,'target'),index(namex,'2005'),index(namex,'2005'),
961               index(namex,'2010'),index(namex,'2015'),index(namex,'2020'),index(namex,'2025')
961 ! ,
962               index(namex,'2030'),index(namex,'2035'),index(namex,'2040'),
963               index(namex,'2045'),index(namex,'2050'),index(namex,'2055')) = 0;
964         drop namex fund_name;
965   run;

NOTE: There were 68402 observations read from the data set WORK.FUNDS4.
NOTE: The data set WORK.FUNDS4 has 67225 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.10 seconds
      

966   
967   data funds4; set funds4;
968       if missing (lipper_obj_cd) then lipper_obj_cd = "OEQ";
969       if lipper_obj_cd = "OEQ" then lipper_obj_name = "Other Equity Funds";
970   run;

NOTE: There were 67225 observations read from the data set WORK.FUNDS4.
NOTE: The data set WORK.FUNDS4 has 67225 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

971   
972   * Select Equity Domestic;
973   data funds4; set funds4;
974       crsp_obj_cd_2 = substr(crsp_obj_cd, 1, 2);
975       new_var = tranwrd(lipper_obj_name, "&", "AND");
976       new_varx = upcase(new_var);
977       drop lipper_obj_name new_var ;
978       rename new_varx = lipper_obj_name;
979   run;

NOTE: There were 67225 observations read from the data set WORK.FUNDS4.
NOTE: The data set WORK.FUNDS4 has 67225 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

980   data funds5; set funds4;
981       if crsp_obj_cd_2 = "ED" ;
982   run;

NOTE: There were 67225 observations read from the data set WORK.FUNDS4.
NOTE: The data set WORK.FUNDS5 has 57904 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

983   
984   proc sql;
985       create table MF_Port (where=(wficn ne .)) as
986       select distinct b.wficn, a.crsp_fundno
987       from /*funds4*/ funds5 as a left join mfl.mflink1 as b
988         on a.crsp_fundno=b.crsp_fundno
989       group by b.wficn
990       order by wficn, crsp_fundno;
NOTE: A GROUP BY clause has been discarded because neither the SELECT clause nor the optional 
      HAVING clause of the associated table-expression referenced a summary function.
NOTE: Table WORK.MF_PORT created, with 17292 rows and 2 columns.

991   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.07 seconds
      cpu time            0.04 seconds
      

992   
993   proc sort data=MF_Port; by wficn; run;

NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

994   
995   
996   /* ******************************************************************************** */
997   /* Part 3:   Merge the List of Domestic all-equity funds and Holdings   *********** */
998   /* ******************************************************************************** */
999   proc sort data=MF_Port; by wficn crsp_fundno; run;

NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1000  
1001  data MF_merged;
1002      merge MF_Holdings(in=a) MF_Port(in=b);
1003      by wficn ;
1004      if b;
1005  run;

NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: There were 43478298 observations read from the data set WORK.MF_HOLDINGS.
NOTE: There were 17292 observations read from the data set WORK.MF_PORT.
NOTE: The data set WORK.MF_MERGED has 19605571 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           4.16 seconds
      cpu time            4.09 seconds
      

1006  
1007  %let md_rdate = (year(rdate)*12 + month(rdate) - 1925*12 - 11);
1008  %let qd_rdate = (year(rdate)*4  + qtr(rdate)   - 1925*4);
1009  data MF_merged;
1010      set MF_merged;
1011      md = &md_rdate;
1012      qd = &qd_rdate;
1013  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1226 at 1:3    1226 at 1:14   1226 at 1:3    1226 at 1:14   
NOTE: There were 19605571 observations read from the data set WORK.MF_MERGED.
NOTE: The data set WORK.MF_MERGED has 19605571 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           5.10 seconds
      cpu time            4.98 seconds
      

1014  
1015  proc sort
1016      data=MF_merged
1017      out=MF_merged nodupkey;
1018      by wficn rdate permno ;
1019  run;

NOTE: There were 19605571 observations read from the data set WORK.MF_MERGED.
NOTE: 646 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED has 19604925 observations and 11 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           4.15 seconds
      cpu time            8.23 seconds
      

1020  
1021  
1022  
1023  /* ******************************************************************************** */
1024  /* Part 4:   Merge holdings with Fund characteristics ***************************** */
1025  /* ******************************************************************************** */
1026  /* sort MF_Port: list of crsp domestic equity funds (include voluntarily disclosed funds)*/
1027  proc sort data=MF_Port; by crsp_fundno; run;

NOTE: There were 17292 observations read from the data set WORK.MF_PORT.
NOTE: The data set WORK.MF_PORT has 17292 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1028  
1029  /* Merge list of domestic quity funds with TNA data */
1030  data returns1; merge MF_Port (in=in1) data.monthly_tna_ret_nav (drop=mnav);  * data is
1030! updated to 2020;
1031        by crsp_fundno;
1032        if in1 = 1;
1033        if wficn ne .;
1034        if mtna < 0 then mtna = .;
1035        mtna = mtna + 0;
1036        mret = mret + 0;
1037        retain tna;
1038        if first.crsp_fundno or mtna ne . then tna = mtna;
1039        rename caldt=date;
1040        drop mtna;
1041  run;

NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      210302 at 1035:19   96743 at 1036:19    
NOTE: There were 17292 observations read from the data set WORK.MF_PORT.
NOTE: There were 8497746 observations read from the data set DATA.MONTHLY_TNA_RET_NAV.
NOTE: The data set WORK.RETURNS1 has 2559609 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           1.35 seconds
      cpu time            0.35 seconds
      

1042  /* get expense ratio data required to get gross returns */
1043  proc sql;
1044        create table returns2 as select a.*, b.exp_ratio
1045        from returns1 (rename=(tna=mtna)) as a left join data.fund_fees as b
1046        on a.crsp_fundno=b.crsp_fundno and date between b.begdt and b.enddt
1047        order by crsp_fundno, date;
NOTE: Table WORK.RETURNS2 created, with 2560265 rows and 6 columns.

1048  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           2.02 seconds
      cpu time            2.34 seconds
      

1049  /* compute gross returns */
1050  data returns2; set returns2;
1051        by crsp_fundno date;
1052        if exp_ratio = -99 then exp_ratio=.;
1053        weight = lag(mtna);
1054        if first.crsp_fundno then weight = mtna;
1055        rret=sum(mret,exp_ratio/12);
1056        *drop exp_ratio;
1057  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      78755 at 1055:12    513949 at 1055:30   
NOTE: There were 2560265 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.RETURNS2 has 2560265 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.32 seconds
      cpu time            0.31 seconds
      

1058  /* aggregate multiple share classes */
1059  proc sort data = returns2; by wficn date; run;

NOTE: There were 2560265 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.RETURNS2 has 2560265 observations and 8 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.47 seconds
      cpu time            0.87 seconds
      

1060  
1061  data multiclass1 oneclass; set returns2;
1062        by wficn date;
1063        if first.date=0 or last.date=0 then output multiclass1;
1064        else output oneclass;
1065  run;

NOTE: There were 2560265 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.MULTICLASS1 has 2035800 observations and 8 variables.
NOTE: The data set WORK.ONECLASS has 524465 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.16 seconds
      cpu time            0.17 seconds
      

1066  
1067  /* aggregate returns to the wficn-month level */
1068  proc sql;
1069        create table multiclass2
1070        as select wficn, date, sum(mret*weight)/sum(weight) as mret,
1071        sum(mtna) as mtna, sum(rret*weight)/sum(weight) as rret
1072        from multiclass1 group by wficn, date;
NOTE: Table WORK.MULTICLASS2 created, with 543345 rows and 5 columns.

1073  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.47 seconds
      cpu time            0.68 seconds
      

1074  
1075  /* create some local date vars for merging */
1076  %let md = (year(date)*12 + month(date) - 1925*12 - 11);
1077  %let qd = (year(date)*4  + qtr(date)   - 1925*4);
1078  
1079  data returns; set oneclass (drop=weight) multiclass2;
1080        md = &md;
1081        qd = &qd;
1082        rename mret=ret mtna=tna;
1083        *drop crsp_fundno ;
1084  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      86 at 1:3    86 at 1:13   86 at 1:3    86 at 1:13   
NOTE: There were 524465 observations read from the data set WORK.ONECLASS.
NOTE: There were 543345 observations read from the data set WORK.MULTICLASS2.
NOTE: The data set WORK.RETURNS has 1067810 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.22 seconds
      cpu time            0.21 seconds
      

1085  proc sort data = returns nodupkey; by wficn md; run;

NOTE: There were 1067810 observations read from the data set WORK.RETURNS.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.RETURNS has 1067810 observations and 9 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.21 seconds
      cpu time            0.34 seconds
      

1086  
1087  * house cleaning;
1088  proc datasets nowarn nolist nodetails;
NOTE: Writing HTML Body file: sashtml.htm
1089        delete multiclass1 multiclass2 oneclass returns1 returns2;
1090  quit;

NOTE: Deleting WORK.MULTICLASS1 (memtype=DATA).
NOTE: Deleting WORK.MULTICLASS2 (memtype=DATA).
NOTE: Deleting WORK.ONECLASS (memtype=DATA).
NOTE: Deleting WORK.RETURNS1 (memtype=DATA).
NOTE: Deleting WORK.RETURNS2 (memtype=DATA).
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.51 seconds
      cpu time            0.29 seconds
      

1091  
1092  data returns;
1093      set returns;
1094      logtna = log(tna);
1095  run;

NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100302 crsp_fundno=008035 date=20080430 ret=0.008234 tna=0 exp_ratio=0.013000
rret=0.0093168663 md=989 qd=334 logtna=. _ERROR_=1 _N_=36579
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100302 crsp_fundno=008035 date=20080530 ret=0.026726 tna=0 exp_ratio=0.013000
rret=0.0278093912 md=990 qd=334 logtna=. _ERROR_=1 _N_=36580
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100503 crsp_fundno=006788 date=20080530 ret=0.038117 tna=0 exp_ratio=0.020000
rret=0.0397832586 md=990 qd=334 logtna=. _ERROR_=1 _N_=60662
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100552 crsp_fundno=013612 date=20080630 ret=. tna=0 exp_ratio=. rret=. md=991 qd=334
logtna=. _ERROR_=1 _N_=65022
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100552 crsp_fundno=013612 date=20080731 ret=. tna=0 exp_ratio=. rret=. md=992 qd=335
logtna=. _ERROR_=1 _N_=65023
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100685 crsp_fundno=008036 date=20080430 ret=0.054511 tna=0 exp_ratio=0.015000
rret=0.0557612782 md=989 qd=334 logtna=. _ERROR_=1 _N_=79237
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100685 crsp_fundno=008036 date=20080530 ret=0.044563 tna=0 exp_ratio=0.015000
rret=0.0458132799 md=990 qd=334 logtna=. _ERROR_=1 _N_=79238
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20080430 ret=0.011013 tna=0 exp_ratio=0.022700
rret=0.0129048825 md=989 qd=334 logtna=. _ERROR_=1 _N_=91934
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20080530 ret=0.052288 tna=0 exp_ratio=0.022700
rret=0.0541792484 md=990 qd=334 logtna=. _ERROR_=1 _N_=91935
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20080630 ret=0.047619 tna=0 exp_ratio=0.022700
rret=0.0495107143 md=991 qd=334 logtna=. _ERROR_=1 _N_=91936
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20080731 ret=-0.033597 tna=0 exp_ratio=0.021700
rret=-0.031788505 md=992 qd=335 logtna=. _ERROR_=1 _N_=91937
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20080829 ret=-0.036810 tna=0 exp_ratio=0.021700
rret=-0.035001483 md=993 qd=335 logtna=. _ERROR_=1 _N_=91938
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20080930 ret=-0.097665 tna=0 exp_ratio=0.021700
rret=-0.09585621 md=994 qd=335 logtna=. _ERROR_=1 _N_=91939
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20081031 ret=0.002353 tna=0 exp_ratio=0.021700
rret=0.0041612745 md=995 qd=336 logtna=. _ERROR_=1 _N_=91940
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20081128 ret=0.002347 tna=0 exp_ratio=0.021700
rret=0.0041557512 md=996 qd=336 logtna=. _ERROR_=1 _N_=91941
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20081231 ret=0.000000 tna=0 exp_ratio=0.021700
rret=0.0018083333 md=997 qd=336 logtna=. _ERROR_=1 _N_=91942
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20090130 ret=-0.002342 tna=0 exp_ratio=0.021700
rret=-0.000533587 md=998 qd=337 logtna=. _ERROR_=1 _N_=91943
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20090227 ret=-0.002347 tna=0 exp_ratio=0.021700
rret=-0.000539085 md=999 qd=337 logtna=. _ERROR_=1 _N_=91944
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
wficn=100789 crsp_fundno=009208 date=20090331 ret=0.000000 tna=0 exp_ratio=0.021700
rret=0.0018083333 md=1000 qd=337 logtna=. _ERROR_=1 _N_=91945
NOTE: Invalid argument to function LOG(0) at line 1094 column 14.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
wficn=100789 crsp_fundno=009208 date=20090430 ret=0.000000 tna=0 exp_ratio=0.021700
rret=0.0018083333 md=1001 qd=338 logtna=. _ERROR_=1 _N_=91946
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      9112 at 1094:14   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      179 at 1094:14   
NOTE: There were 1067810 observations read from the data set WORK.RETURNS.
NOTE: The data set WORK.RETURNS has 1067810 observations and 10 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.06 seconds
      

1096  
1097  
1098  
1099  * Obtain fund characteristics ;
1100  %let md = (year(caldt)*12 + month(caldt) - 1925*12 - 11);
1101  %let qd = (year(caldt)*4  + qtr(caldt)   - 1925*4);
1102  data fundchars; merge MF_Port (in=in1) data.fund_summary2;
1103      by crsp_fundno;
1104      md = &md;
1105      qd = &qd;
1106      fundage = log(year(caldt) - year(first_offer_dt));
1107      per_cash2 = sum(per_cash, per_muni, per_govt )/100;
1108      per_cash = per_cash/100;
1109      if wficn ne .;
1110      rename caldt=date;
1111      keep crsp_fundno wficn caldt date mgmt_fee turn_ratio first_offer_dt
1112      mgmt_name mgmt_cd fundage md qd per_cash per_muni per_govt per_cash2 nav_latest ;
1113  run;

WARNING: The variable date in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000001 summary_period2=A caldt=19971231 summary_period=A
nav_latest=15.3000000 nav_latest_dt=19971231 tna_latest=81.000 tna_latest_dt=19971231
yield=0.0620065359 div_ytd=0.94870000000 cap_gains_ytd=0.02000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630 per_com=0
per_pref=0 per_conv=0 per_corp=88.13 per_muni=0 per_govt=3.34 per_oth=0.02 per_cash=0.0851
per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=9.8 maturity_dt=19980630
cusip8=  crsp_portno=. crsp_cl_grp=. fund_name=AARP Income Tr:Bond for Income ticker=AABIX
ncusip=  mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Stephen A Wohler mgr_dt=19970201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19970201 end_dt=20000731 dead_flag=Y
merge_fundno=008441 actual_12b1=0.000000 max_12b1=. mgmt_fee=-0.282000 exp_ratio=0.001900
turn_ratio=1.310000 fiscal_yearend=19980930 crsp_obj_cd=ICQM si_obj_cd=CMQ accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865
qd=292 fundage=. per_cash2=0.1185 _ERROR_=1 _N_=1
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=1 wficn=301534 crsp_fundno=000002 summary_period2=A caldt=19971231 summary_period=A
nav_latest=17.0900000 nav_latest_dt=19971231 tna_latest=72.000 tna_latest_dt=19971231
yield=0.0187244002 div_ytd=0.32000000000 cap_gains_ytd=0.10000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=98.55 per_cash=0.0145 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=.
crsp_cl_grp=. fund_name=AARP Mngd Inv Port Tr:Diversified Growth ticker=AADGX ncusip= 
mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Philip S Fortuna mgr_dt=19970201 adv_name= 
open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N et_flag= 
delist_cd=  header=0 first_offer_dt=19970203 end_dt=20000831 dead_flag=Y merge_fundno=008425
actual_12b1=0.000000 max_12b1=. mgmt_fee=0.000000 exp_ratio=0.000000 turn_ratio=0.060000
fiscal_yearend=19980930 crsp_obj_cd=EDYG si_obj_cd=GRO accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865 qd=292 fundage=.
per_cash2=0.0145 _ERROR_=1 _N_=10
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000003 summary_period2=A caldt=19931231 summary_period=A
nav_latest=10.4200000 nav_latest_dt=19931231 tna_latest=0.013 tna_latest_dt=19931231
yield=0.0574856046 div_ytd=0.59900000000 cap_gains_ytd=0.40580000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19931231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Rembrandt Funds:Global Fixed Income Fund/Inv ticker=  ncusip= 
mgmt_name=LaSalle Street Capital Mgmt Ltd mgmt_cd=  mgr_name=Roy Scheepe mgr_dt=19930201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930426 end_dt=20000831 dead_flag=Y merge_fundno=.
actual_12b1=0.002500 max_12b1=. mgmt_fee=. exp_ratio=0.015600 turn_ratio=1.460000
fiscal_yearend=. crsp_obj_cd=IF si_obj_cd=BGN accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817 qd=276 fundage=. per_cash2=0
_ERROR_=1 _N_=19
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000004 summary_period2=A caldt=19971231 summary_period=A
nav_latest=16.4600000 nav_latest_dt=19971231 tna_latest=23.800 tna_latest_dt=19971231
yield=0.0066828676 div_ytd=0.11000000000 cap_gains_ytd=0.15000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630
per_com=91.3 per_pref=1.1 per_conv=1.4 per_corp=0 per_muni=0 per_govt=0 per_oth=0.3
per_cash=0.059 per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0
maturity_dt=19980630 cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AARP Growth Tr:International Growth & Income ticker=AAISX ncusip= 
mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Sheridan Reilly mgr_dt=19970201 adv_name= 
open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N et_flag= 
delist_cd=  header=0 first_offer_dt=19970203 end_dt=20000731 dead_flag=Y merge_fundno=008513
actual_12b1=0.000000 max_12b1=. mgmt_fee=0.222000 exp_ratio=0.017500 turn_ratio=0.750000
fiscal_yearend=19980930 crsp_obj_cd=EFYT si_obj_cd=EIT accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865 qd=292 fundage=.
per_cash2=0.059 _ERROR_=1 _N_=32
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000008 summary_period2=A caldt=19901231 summary_period=A
nav_latest=13.2700000 nav_latest_dt=19901231 tna_latest=0.160 tna_latest_dt=19901231
yield=0.0021929164 div_ytd=0.02910000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=EQUITABLE BALANCED FUND/A ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19900901 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101 end_dt=19990129 dead_flag=Y
merge_fundno=004089 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=. per_cash2=0
_ERROR_=1 _N_=54
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000009 summary_period2=A caldt=19871231 summary_period=A
nav_latest=10.7000000 nav_latest_dt=19871231 tna_latest=1.980 tna_latest_dt=19871231
yield=0.0002336449 div_ytd=0.00250000000 cap_gains_ytd=0.05510000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19871231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Equitable Balanced B ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name=  mgr_dt=19871001
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19870101 end_dt=19990129 dead_flag=Y
merge_fundno=004090 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=745 qd=252 fundage=. per_cash2=0
_ERROR_=1 _N_=64
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000010 summary_period2=A caldt=19931231 summary_period=A
nav_latest=15.2500000 nav_latest_dt=19931231 tna_latest=0.971 tna_latest_dt=19931231
yield=0.008852459 div_ytd=0.13500000000 cap_gains_ytd=1.17000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19940630
per_com=54.5 per_pref=0 per_conv=2.7 per_corp=4.7 per_muni=0 per_govt=13.1 per_oth=0
per_cash=0.25 per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0
maturity_dt=19940630 cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Alliance Port:Strategic Balanced Fund/C ticker=  ncusip= 
mgmt_name=ALLIANCE CAPITAL MANAGEMENT CORP. mgmt_cd=  mgr_name=Judith Taylor mgr_dt=19930801
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930101 end_dt=19990129 dead_flag=Y
merge_fundno=004091 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.021000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=M si_obj_cd=BAL accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817 qd=276 fundage=. per_cash2=0.381
_ERROR_=1 _N_=77
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000012 summary_period2=A caldt=19941230 summary_period=A
nav_latest=14.3200000 nav_latest_dt=19941230 tna_latest=177.932 tna_latest_dt=19941230
yield=0.0275837989 div_ytd=0.39500000000 cap_gains_ytd=0.03900000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19950929 per_com=52
per_pref=0 per_conv=4 per_corp=4 per_muni=0 per_govt=19 per_oth=3 per_cash=0.18 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19950929 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AARP Growth Tr:Balanced Stock and Bond Fund ticker=ABSBX
ncusip=  mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Robert T Hoffman mgr_dt=19940201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19940201 end_dt=20000731 dead_flag=Y
merge_fundno=028248 actual_12b1=0.000000 max_12b1=. mgmt_fee=. exp_ratio=0.010100
turn_ratio=0.637700 fiscal_yearend=. crsp_obj_cd=M si_obj_cd=BAL accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=829 qd=280 fundage=.
per_cash2=0.37 _ERROR_=1 _N_=90
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000015 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.1700000 nav_latest_dt=19911231 tna_latest=5.750 tna_latest_dt=19911231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.06000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GLOBAL EQUITY FUND/A ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19910801 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19980529 dead_flag=Y merge_fundno=031048 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=121
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000016 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.2300000 nav_latest_dt=19911231 tna_latest=0.558 tna_latest_dt=19911231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.06000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GLOBAL EQUITY FUND/B ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19911101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19980529 dead_flag=Y merge_fundno=031046 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=129
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000017 summary_period2=A caldt=19931231 summary_period=A
nav_latest=11.5500000 nav_latest_dt=19931231 tna_latest=2.570 tna_latest_dt=19931231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.04250000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19940630 per_com=93 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0.07 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19940630 cusip8=  crsp_portno=.
crsp_cl_grp=. fund_name=American Capital World:Global Equity Fund/C ticker=ACGCX ncusip= 
mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=Jeff New mgr_dt=19940401
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930101 end_dt=19980529 dead_flag=Y
merge_fundno=031045 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.032100
turn_ratio=1.160000 fiscal_yearend=. crsp_obj_cd=EFYG si_obj_cd=EGG accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817
qd=276 fundage=. per_cash2=0.07 _ERROR_=1 _N_=137
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000018 summary_period2=A caldt=19761231 summary_period=A
nav_latest=24.5800000 nav_latest_dt=19761231 tna_latest=11.100 tna_latest_dt=19761231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19761231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=American General Muni Bond Fund ticker=ACMBX ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19880101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19760101 end_dt=19950831 dead_flag=Y
merge_fundno=030948 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=Bonds lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=613 qd=208 fundage=.
per_cash2=0 _ERROR_=1 _N_=143
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000019 summary_period2=A caldt=19921231 summary_period=A
nav_latest=10.0200000 nav_latest_dt=19921231 tna_latest=3.773 tna_latest_dt=19921231
yield=0.0185628743 div_ytd=0.18600000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19930331 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=95 per_govt=0 per_oth=0 per_cash=0.05 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=21.3 maturity_dt=19930331 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AMERICAN CAPITAL MUNICIPAL BOND FUND/B ticker=  ncusip= 
mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=ROBERT EVANS mgr_dt=19920901
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19920101 end_dt=19950831 dead_flag=Y
merge_fundno=030949 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.017100 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IU si_obj_cd=MGN accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805 qd=272 fundage=. per_cash2=1
_ERROR_=1 _N_=163
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000020 summary_period2=A caldt=19931231 summary_period=A
nav_latest=10.5200000 nav_latest_dt=19931231 tna_latest=4.137 tna_latest_dt=19931231
yield=0.0199619772 div_ytd=0.21000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19931231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=American Capital Municipal Bond Fund/C ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19950401 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19930101
end_dt=19950831 dead_flag=Y merge_fundno=030950 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817
qd=276 fundage=. per_cash2=0 _ERROR_=1 _N_=167
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000021 summary_period2=A caldt=19901231 summary_period=A
nav_latest=9.9800000 nav_latest_dt=19901231 tna_latest=15.582 tna_latest_dt=19901231
yield=0.0095190381 div_ytd=0.09500000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GOVERNMENT TGT SRS-PORT '97 ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19900901 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101
end_dt=19971128 dead_flag=Y merge_fundno=. actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000
turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=.
per_cash2=0 _ERROR_=1 _N_=170
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000022 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.7600000 nav_latest_dt=19911231 tna_latest=8.795 tna_latest_dt=19911231
yield=0.0269516729 div_ytd=0.29000000000 cap_gains_ytd=0.04250000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GOVERNMENT TGT SRS-PORT '98 ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19910101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19930331 dead_flag=Y merge_fundno=006281 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=178
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000024 summary_period2=A caldt=19901231 summary_period=A
nav_latest=9.9000000 nav_latest_dt=19901231 tna_latest=26.050 tna_latest_dt=19901231
yield=0.0001010101 div_ytd=0.00100000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Axe-Core Int'l ADR Fund ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19901101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101 end_dt=19920630 dead_flag=Y
merge_fundno=. actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=. per_cash2=0
_ERROR_=1 _N_=182
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=1 wficn=100154 crsp_fundno=000025 summary_period2=A caldt=19921231 summary_period=A
nav_latest=17.6200000 nav_latest_dt=19921231 tna_latest=0.285 tna_latest_dt=19921231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19921231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Ambassador Funds:Established Co Gr/Retail A ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19930501 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19920101
end_dt=19950531 dead_flag=Y merge_fundno=021286 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805
qd=272 fundage=. per_cash2=0 _ERROR_=1 _N_=185
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
in1=0 wficn=. crsp_fundno=000026 summary_period2=A caldt=19951229 summary_period=A
nav_latest=10.2100000 nav_latest_dt=19951229 tna_latest=0.202 tna_latest_dt=19951229
yield=0.0266405485 div_ytd=0.27200000000 cap_gains_ytd=0.05100000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19960329 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=97.4 per_govt=0 per_oth=0 per_cash=0.026 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19960329 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=Achievement Fds Trust:Short Term Muni/Retail ticker= 
ncusip=  mgmt_name=SEI FINANCIAL MANAGEMENT CORP. mgmt_cd=  mgr_name=James A Schuck
mgr_dt=19950301 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=L header=1 first_offer_dt=19950101 end_dt=19990331 dead_flag=Y
merge_fundno=. actual_12b1=0.002500 max_12b1=. mgmt_fee=. exp_ratio=0.010000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IUS si_obj_cd=MSM accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=0 LAST.crsp_fundno=0 md=841 qd=284 fundage=. per_cash2=1
_ERROR_=1 _N_=190
NOTE: Invalid argument to function LOG(0) at line 1106 column 15.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
in1=0 wficn=. crsp_fundno=000028 summary_period2=A caldt=19921231 summary_period=A
nav_latest=11.3500000 nav_latest_dt=19921231 tna_latest=11.986 tna_latest_dt=19921231
yield=0.0220264317 div_ytd=0.25000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19930331 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=90 per_govt=0 per_oth=0 per_cash=0.1 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=19.6 maturity_dt=19930331 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AMERICAN CAPITAL TXEX TRUST-INSURED MUNI/B ticker=ACTJX
ncusip=  mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=BOB EVANS mgr_dt=19920701
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19920101 end_dt=19950831 dead_flag=Y
merge_fundno=030993 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.018200 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IU si_obj_cd=MIS accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805 qd=272 fundage=. per_cash2=1
_ERROR_=1 _N_=206
NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      13 at 1:3           13 at 1:14          13 at 1:3           13 at 1:14
      24043 at 1106:15    13 at 1106:19       24043 at 1106:31    24043 at 1106:33
      453569 at 1107:17   453569 at 1107:51   453569 at 1108:24   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      123000 at 1106:15   
NOTE: There were 17292 observations read from the data set WORK.MF_PORT.
NOTE: There were 2500116 observations read from the data set DATA.FUND_SUMMARY2.
NOTE: The data set WORK.FUNDCHARS has 737202 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           1.66 seconds
      cpu time            1.64 seconds
      

1114  
1115  proc sort data=fundchars; by wficn date; run;

NOTE: There were 737202 observations read from the data set WORK.FUNDCHARS.
NOTE: The data set WORK.FUNDCHARS has 737202 observations and 16 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.30 seconds
      cpu time            0.37 seconds
      

1116  
1117  * Get hand-checked management name and code;
1118  proc import out      = std_mgmt_names
1119              datafile =
1119! 'C:/Users/hpham13/Projects/mf_activism/empirical/0_input/original/mff_names_dedup2023.xlsx'
1120              dbms     = xlsx
1121              replace;
1122  run;

NOTE: One or more variables were converted because the data type is not supported by the V9 
      engine. For more details, run with options MSGLEVEL=I.
NOTE: The import data set has 3132 observations and 7 variables.
NOTE: WORK.STD_MGMT_NAMES data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.17 seconds
      cpu time            0.18 seconds
      

1123  proc sort data=std_mgmt_names nodupkey; by mgmt_name ; run;

NOTE: There were 3132 observations read from the data set WORK.STD_MGMT_NAMES.
NOTE: 327 observations with duplicate key values were deleted.
NOTE: The data set WORK.STD_MGMT_NAMES has 2805 observations and 7 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

1124  
1125  * merge corrected_mgmt_cd to fundchars ;
1126  proc sql;
1127      create table fundchars as
1128      select a.*, b.corrected_mgmt_cd
1129      from fundchars as a left join std_mgmt_names as b
1130      on a.mgmt_name=b.mgmt_name ;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.FUNDCHARS created, with 737202 rows and 17 columns.

1131  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.53 seconds
      cpu time            0.60 seconds
      

1132  
1133  * if corrected_mgmt_cd is missing, replace by original mgmt_cd and rename ;
1134  data fundchars; set fundchars;
1135      if missing(corrected_mgmt_cd) and not missing(mgmt_cd) then corrected_mgmt_cd = mgmt_cd
1135!  ;
1136      if missing(corrected_mgmt_cd) and missing(mgmt_cd) and not missing(mgmt_name) then
1136! corrected_mgmt_cd = mgmt_name ;
1137      drop mgmt_cd;
1138      label corrected_mgmt_cd="Management Company Code";
1139      rename corrected_mgmt_cd= mgmt_cd ;
1140  run;

NOTE: There were 737202 observations read from the data set WORK.FUNDCHARS.
NOTE: The data set WORK.FUNDCHARS has 737202 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.09 seconds
      

1141  
1142  /* Merge data*/
1143  proc sql;
1144      create table returns_merged as
1145      select a.*, b.crsp_fundno, b.fundage, b.turn_ratio, b.md, b.qd, b.mgmt_name, b.mgmt_cd,
1146             b.per_cash, b.per_muni, b.per_govt, b.per_cash2, (b.per_cash * a.tna) as mfcash,
1147             (b.per_cash2 * a.tna) as mfcash2, b.nav_latest
1148      from returns (where = (date between "&begdate"d and "&enddate"d)) as a
1149      left join fundchars as b
1150        on a.wficn = b.wficn
1151       and a.qd    = b.qd;
WARNING: Variable crsp_fundno already exists on file WORK.RETURNS_MERGED.
WARNING: Variable md already exists on file WORK.RETURNS_MERGED.
WARNING: Variable qd already exists on file WORK.RETURNS_MERGED.
NOTE: Table WORK.RETURNS_MERGED created, with 2187051 rows and 21 columns.

1152  
1153      create view MF_merged2 as
1154      select a.*, b.tna label = 'TNA ($millions)', b.exp_ratio, b.rret, b.mgmt_name,
1154! b.mgmt_cd
1155      from MF_merged as a
1156      left join
1157           ( select wficn, md, qd, tna, exp_ratio, rret, mgmt_name, mgmt_cd
1158               from returns_merged
1159           ) as b
1160        on a.wficn = b.wficn
1161       and a.md    = b.md;
NOTE: SQL view WORK.MF_MERGED2 has been defined.
1162  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.12 seconds
      cpu time            1.35 seconds
      

1163  
1164  
1165  /* ******************************************************************************** */
1166  /* Part 5:   Compute ownership and define large holding families   **************** */
1167  /* ******************************************************************************** */
1168  proc sort data = MF_merged2
1169            out  = MF_merged3
1170            nodupkey;
1171      by permno rdate wficn;
1172  run;

NOTE: There were 57018050 observations read from the data set WORK.MF_MERGED2.
NOTE: 37413125 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED3 has 19604925 observations and 16 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           23.23 seconds
      cpu time            46.01 seconds
      

1173  
1174  data MF_merged3;
1175      set MF_merged3;
1176      if rdate ne .;
1177      if not missing(mgmt_cd);
1178  run;

NOTE: There were 19604925 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17727460 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           4.37 seconds
      cpu time            4.09 seconds
      

1179  
1180  proc sql;
1181      create table MF_merged3 as
1182      select *, sum(shares_adj) as shares_adj_mff
1183      from MF_merged3
1184      group permno, rdate, mgmt_cd   ;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 17727460 rows and 17 columns.

1185  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           15.83 seconds
      cpu time            20.39 seconds
      

1186  
1187  proc sql;
1188      create table MF_merged3 as
1189      select *, count(distinct permno) as num_firms
1190      from MF_merged3
1191      group by mgmt_cd, rdate ;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 17727460 rows and 18 columns.

1192  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           18.11 seconds
      cpu time            24.86 seconds
      

1193  proc sort data=MF_merged3;
1194      by permno rdate mgmt_cd;
1195  run;

NOTE: There were 17727460 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17727460 observations and 18 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           10.26 seconds
      cpu time            16.81 seconds
      

1196  
1197  * follow the literature, we exclude observations with TNA does not exceed $1mil and
1197! num_firms does not exceed 10.;
1198  data MF_merged3;
1199      set MF_merged3;
1200      if tna > 1;
1201      if num_firms > 10;
1202  run;

NOTE: There were 17727460 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17660353 observations and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           4.27 seconds
      cpu time            4.01 seconds
      

1203  
1204  data MF_merged3; set MF_merged3;
1205      drop shares_adj exp_ratio rret  ;
1206  run;

NOTE: There were 17660353 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17660353 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           4.14 seconds
      cpu time            3.76 seconds
      

1207  
1208  data MF_merged3; set MF_merged3;
1209      rename  shares_adj_mff=shares_adj;
1210      label shares_adj_mff = "Total shares at MFF";
1211  run;

NOTE: There were 17660353 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 17660353 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           4.03 seconds
      cpu time            3.71 seconds
      

1212  
1213  * get TSO ;
1214  data MF_merged3;
1215      merge MF_merged3(in=a) price (in=b rename=(qdate=rdate));
1216      by permno rdate;
1217      if b and TSO>0;
1218      MFOR = shares_adj/TSO;
1219      label MFOR = "MFOwn MFF-Firm-Level";
1220      format MFOR percentn8.4;
1221      format prc P P_1 ME comma8.3;
1222      if wficn ne . ;
1223  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      369444 at 1218:22   
NOTE: There were 17660353 observations read from the data set WORK.MF_MERGED3.
NOTE: There were 788968 observations read from the data set WORK.PRICE.
NOTE: The data set WORK.MF_MERGED3 has 14317291 observations and 23 variables.
NOTE: DATA statement used (Total process time):
      real time           5.19 seconds
      cpu time            4.98 seconds
      

1224  
1225  * add back the pre-adjusted shares;
1226  data MF_merged3; set MF_merged3;
1227      absprc = abs(prc);
1228      shares = shares_adj/CFACSHR ;
1229  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      6636 at 1227:14   
NOTE: There were 14317291 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 14317291 observations and 25 variables.
NOTE: DATA statement used (Total process time):
      real time           4.75 seconds
      cpu time            4.09 seconds
      

1230  
1231  
1232  * Compute the firm weight in a mutual fund portfolio at the mutual fund - quarter level;
1233  * Define firm weight = Firm's mkt value / MF's AUM;
1234  proc sql;
1235      create table MF_merged3 as
1236      select *, (shares_adj*P)/sum(shares_adj*P) as fweight label="Firm weight" format
1236! percentn8.4
1237      from MF_merged3
1238      group by mgmt_cd, rdate
1239      order by mgmt_cd, rdate, permno;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 14317291 rows and 26 columns.

1240  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           23.60 seconds
      cpu time            33.40 seconds
      

1241  
1242  data MF_merged3; set MF_merged3;
1243      drop wficn fundno crsp_fundno;
1244      if not missing(mgmt_cd) ;
1245      ryear = year(rdate);
1246  run;

NOTE: There were 14317291 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 14317291 observations and 24 variables.
NOTE: DATA statement used (Total process time):
      real time           5.04 seconds
      cpu time            4.43 seconds
      

1247  
1248  proc sql;
1249      create table MF_merged3 as
1250      select *,
1251          sum(shares_adj*P)/1000000 as AUM label="AUM, adjusted ($mil)" format comma8.2,
1252          sum(shares*prc)/1000000 as AUM2 label="AUM ($mil)" format comma8.2
1253      from MF_merged3
1254      group by mgmt_cd, rdate
1255      order by mgmt_cd, rdate, permno;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 14317291 rows and 26 columns.

1256  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           22.12 seconds
      cpu time            30.76 seconds
      

1257  
1258  proc sort data= MF_merged3 nodupkey; by mgmt_cd permno rdate; run;

NOTE: There were 14317291 observations read from the data set WORK.MF_MERGED3.
NOTE: 5172414 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED3 has 9144877 observations and 26 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           7.19 seconds
      cpu time            11.22 seconds
      

1259  
1260  
1261  
1262  * Compute the change of ownership and change of Firm weight;
1263  proc sort data= MF_merged3; by mgmt_cd permno rdate; run;

NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1264  data MF_merged3; set MF_merged3;
1265      by mgmt_cd permno ;
1266      MFOR_l = lag(MFOR);
1267      fweight_l = lag(fweight);
1268      if first.permno then MFOR_l=.;
1269      if first.permno then fweight_l=.;
1270      changefweight = fweight - fweight_l ;
1271      changeMFOR = MFOR - MFOR_l ;
1272      /*assume no change for the first obs*/
1273      if first.permno then changefweight = 0 ;
1274      if first.permno then changeMFOR = 0 ;
1275      if first.permno then delete;
1276      drop MFOR_l fweight_l ;
1277      format fweight changefweight MFOR changeMFOR percentn8.4;
1278  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1112842 at 1270:29   1107196 at 1271:23   
NOTE: There were 9144877 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 8037681 observations and 28 variables.
NOTE: DATA statement used (Total process time):
      real time           3.14 seconds
      cpu time            2.95 seconds
      

1279  
1280  * create the direction of MF trade (up/down MFOR);
1281  proc sql;
1282      create table MF_merged3 as
1283      select *,
1284          case
1285              when changeMFOR > 0 then 1
1286              when changeMFOR = 0 then 0
1287              else - 1
1288          end as uphold
1289      from MF_merged3;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 8037681 rows and 29 columns.

1290  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           2.96 seconds
      cpu time            2.75 seconds
      

1291  
1292  data MF_merged3; set MF_merged3;
1293      label uphold="Incrase (Decrease) MFOR";
1294  run;

NOTE: There were 8037681 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 8037681 observations and 29 variables.
NOTE: DATA statement used (Total process time):
      real time           2.86 seconds
      cpu time            2.42 seconds
      

1295  proc sort data= MF_merged3; by mgmt_cd permno rdate; run;

NOTE: There were 8037681 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 8037681 observations and 29 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           5.92 seconds
      cpu time            7.78 seconds
      

1296  
1297  
1298  * ************************************************
1299  *  make an indicator for large holding (>=1%);
1300  * ************************************************;
1301  data MF_merged3_1; set MF_merged3;
1302      MFORpct = round(MFOR*100, 0.01);
1303      if MFORpct >= 1 then LargeMF = 1; else LargeMF = 0;
1304  run;

NOTE: There were 8037681 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3_1 has 8037681 observations and 31 variables.
NOTE: DATA statement used (Total process time):
      real time           2.53 seconds
      cpu time            2.40 seconds
      

1305  
1306  proc sql;
1307      create table MF_merged3_1 as
1308      select *, max(LargeMF) as LargeMF2 label="Have LargeMF"
1309      from  MF_merged3_1
1310      where shares_adj > 0
1311      group by permno, rdate
1312      having LargeMF2=1
1313      order by permno, rdate, mgmt_cd;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3_1 created, with 7118887 rows and 32 columns.

1314  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           15.73 seconds
      cpu time            19.43 seconds
      

1315  
1316  
1317  *****************************************************************************************
1318  * Start the AUM code
1319  *****************************************************************************************;
1320  
1321  * Macros ;
1322  %macro stats1(input, output, statvar);
1323  ** get p90, p95, p98 for all MF ;
1324  proc univariate  data=&input. noprint;
1325      VAR &statvar. ;
1326      output out=&output.
1327          mean=mean
1328          median=median
1329          std=std_dev
1330          min=min
1331          max=max
1332          pctlpre=pctl_
1333          pctlpts=10
1334          pctlpts=20
1335          pctlpts=30
1336          pctlpts=40
1337          pctlpts=50
1338          pctlpts=60
1339          pctlpts=70
1340          pctlpts=80
1341          pctlpts=90
1342          pctlpts=95
1343          pctlpts=98;
1344  run;
1345  data &output. ; set &output. ;
1346      format mean median std_dev min max pctl_10 pctl_20 pctl_30 pctl_40 pctl_50 pctl_60
1346! pctl_70 pctl_80 pctl_90 pctl_95 pctl_98 comma8.2 ;
1347  run;
1348  %mend;
1349  
1350  
1351  %macro stats2(input, output, statvar, byvar);
1352  ** get p90, p95, p98 for by group  ;
1353  proc sort data= &input. nodupkey; by &byvar. rdate permno; run;
1354  proc univariate  data=&input. noprint;
1355      VAR &statvar. ;
1356      BY  &byvar. ;
1357      output out=&output.
1358          mean=mean
1359          median=median
1360          std=std_dev
1361          min=min
1362          max=max
1363          pctlpre=pctl_
1364          pctlpts=10
1365          pctlpts=20
1366          pctlpts=30
1367          pctlpts=40
1368          pctlpts=50
1369          pctlpts=60
1370          pctlpts=70
1371          pctlpts=80
1372          pctlpts=90
1373          pctlpts=95
1374          pctlpts=98;
1375  run;
1376  data &output. ; set &output. ;
1377      format mean median std_dev min max pctl_10 pctl_20 pctl_30 pctl_40 pctl_50 pctl_60
1377! pctl_70 pctl_80 pctl_90 pctl_95 pctl_98 comma8.2 ;
1378  run;
1379  %mend;
1380  
1381  * ============================================================================== ;
1382  *                       PART 1: COMPUTE THE AUM PERCENTILES
1383  * ============================================================================== ;
1384  * exclude negative AUM (sometime price <0);
1385  data MF_merged3_1; set MF_merged3_1;
1386      if AUM2 >= 0 ;
1387  run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1.
NOTE: The data set WORK.MF_MERGED3_1 has 7118887 observations and 32 variables.
NOTE: DATA statement used (Total process time):
      real time           2.28 seconds
      cpu time            2.25 seconds
      

1388  
1389  data AUM_ijt; set MF_merged3_1;
1390      keep permno rdate AUM2 mgmt_cd LargeMF ;
1391  run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1.
NOTE: The data set WORK.AUM_IJT has 7118887 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           1.49 seconds
      cpu time            1.15 seconds
      

1392  * distribution of AUM at the ijt level: whole sample and by group LargeMF;
1393  %stats1(input = AUM_ijt, output = _stats_ijt_1_ , statvar = AUM2);

NOTE: The data set WORK._STATS_IJT_1_ has 1 observations and 16 variables.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           2.75 seconds
      cpu time            2.64 seconds
      


NOTE: There were 1 observations read from the data set WORK._STATS_IJT_1_.
NOTE: The data set WORK._STATS_IJT_1_ has 1 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

1394  %stats2(input = AUM_ijt, output = _stats_ijt_2_ , statvar = AUM2, byvar = LargeMF);

NOTE: There were 7118887 observations read from the data set WORK.AUM_IJT.
NOTE: 6583321 observations with duplicate key values were deleted.
NOTE: The data set WORK.AUM_IJT has 535566 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.89 seconds
      cpu time            2.31 seconds
      


NOTE: The data set WORK._STATS_IJT_2_ has 2 observations and 17 variables.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           0.18 seconds
      cpu time            0.17 seconds
      


NOTE: There were 2 observations read from the data set WORK._STATS_IJT_2_.
NOTE: The data set WORK._STATS_IJT_2_ has 2 observations and 17 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

1395  
1396  
1397  * Compute percentiles of AUM2 at the ijt level for each quarter  ;
1398  data AUM_ijt; set MF_merged3_1;
1399      keep mgmt_cd rdate AUM2 ;
1400  run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1.
NOTE: The data set WORK.AUM_IJT has 7118887 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           1.21 seconds
      cpu time            1.18 seconds
      

1401  proc sort data=AUM_ijt nodupkey; by rdate mgmt_cd AUM2; run;

NOTE: There were 7118887 observations read from the data set WORK.AUM_IJT.
NOTE: 7087479 observations with duplicate key values were deleted.
NOTE: The data set WORK.AUM_IJT has 31408 observations and 3 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.98 seconds
      cpu time            2.48 seconds
      

1402  ** get p90, p95, p98 for Large MF;
1403  proc univariate  data=AUM_ijt noprint;
1404      VAR AUM2;
1405      BY rdate  ;
1406      output out=_stats_
1407          pctlpre=pctl_
1408          pctlpts=90
1409          pctlpts=95
1410          pctlpts=98;
1411  run;

NOTE: The data set WORK._STATS_ has 92 observations and 4 variables.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

1412  
1413  
1414  * ============================================================================== ;
1415  *                   PART 2: DETERMINE THE AUM PERCENTILE
1416  *                   IN THE PAPER, WE USE 90TH AND 95TH
1417  * ============================================================================== ;
1418  * Merge percentile to main data ;
1419  data _stats_ ; set _stats_ ;
1420      format pctl_90 pctl_95 pctl_98 comma8.2 ;
1421  run;

NOTE: There were 92 observations read from the data set WORK._STATS_.
NOTE: The data set WORK._STATS_ has 92 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1422  data MF_merged3_1; set MF_merged3_1; pkey=1; run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1.
NOTE: The data set WORK.MF_MERGED3_1 has 7118887 observations and 33 variables.
NOTE: DATA statement used (Total process time):
      real time           2.45 seconds
      cpu time            2.39 seconds
      

1423  data _stats_ ; set _stats_ ; pkey=1; run;

NOTE: There were 92 observations read from the data set WORK._STATS_.
NOTE: The data set WORK._STATS_ has 92 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

1424  
1425  proc sql;
1426      create table MF_merged3_1 as
1427      select a.*, b.pctl_90, b.pctl_95, b.pctl_98
1428      from MF_merged3_1 as a left join _stats_  as b
1429      on a.rdate=b.rdate and a.pkey=b.pkey;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3_1 created, with 7118887 rows and 36 columns.

1430  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           8.89 seconds
      cpu time            11.46 seconds
      

1431  proc sort data=MF_merged3_1 ; by permno rdate mgmt_cd descending LargeMF; run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1.
NOTE: The data set WORK.MF_MERGED3_1 has 7118887 observations and 36 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           6.05 seconds
      cpu time            9.17 seconds
      

1432  
1433  * ----------------------------------------------------------;
1434  /* First, select pctl_90 or pctl_95 */
1435  * ----------------------------------------------------------;
1436  data MF_merged3_1a; set MF_merged3_1;
1437      if  MFOR <  0.01 then do;
1438  
1439          * compare AUM_ijt with the AUM percentile -- only select one percentile, run the
1439! code separately;
1440  
1441  /*      if AUM2 >= pctl_90 then Pseudo_LargeMF = 1;*/
1442          if AUM2 >= pctl_95 then Pseudo_LargeMF = 1;
1443          else Pseudo_LargeMF = . ;
1444      end;
1445  run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1.
NOTE: The data set WORK.MF_MERGED3_1A has 7118887 observations and 37 variables.
NOTE: DATA statement used (Total process time):
      real time           2.34 seconds
      cpu time            2.31 seconds
      

1446  
1447  * SELECT ONLY ONE CASE: P90 OR P95, comment out the other;
1448  
1449  /** If you use AUM threshold 90pct;*/
1450  /*data MF_merged3_1a; set MF_merged3_1a;*/
1451  /*  if LargeMF=1 & AUM2 >= pctl_90 then BH_largeAUM = 1; else BH_largeAUM = 0;*/
1452  /*  if LargeMF=0 & AUM2 >= pctl_90 then nonBH_LargeAUM = 1; else nonBH_LargeAUM = 0;*/
1453  /*  if LargeMF=1 & AUM2 <  pctl_90 then BH_SmallAUM = 1; else BH_SmallAUM = 0;*/
1454  /*  if LargeMF=0 & AUM2 <  pctl_90 then nonBH_SmallAUM = 1 ; else nonBH_SmallAUM = 0;*/
1455  /*run;*/
1456  
1457  * If you use AUM threshold 95pct;
1458  data MF_merged3_1a; set MF_merged3_1a;
1459      if LargeMF=1 & AUM2 >= pctl_95 then BH_largeAUM = 1; else BH_largeAUM = 0;
1460      if LargeMF=0 & AUM2 >= pctl_95 then nonBH_LargeAUM = 1; else nonBH_LargeAUM = 0;
1461      if LargeMF=1 & AUM2 <  pctl_95 then BH_SmallAUM = 1; else BH_SmallAUM = 0;
1462      if LargeMF=0 & AUM2 <  pctl_95 then nonBH_SmallAUM = 1 ; else nonBH_SmallAUM = 0;
1463  run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1A.
NOTE: The data set WORK.MF_MERGED3_1A has 7118887 observations and 41 variables.
NOTE: DATA statement used (Total process time):
      real time           2.98 seconds
      cpu time            2.78 seconds
      

1464  
1465  * Next, count at the firm-quarter-mff level;
1466  proc sql;
1467      create table MF_merged3_1a as
1468      select *,
1469      sum(BH_largeAUM) as tot_BH_largeAUM,
1470      sum(nonBH_LargeAUM) as tot_nonBH_LargeAUM,
1471      sum(BH_SmallAUM) as tot_BH_SmallAUM,
1472      sum(nonBH_SmallAUM) as tot_nonBH_SmallAUM
1473      from MF_merged3_1a
1474      group by permno, rdate;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3_1A created, with 7118887 rows and 45 columns.

1475  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           11.53 seconds
      cpu time            13.60 seconds
      

1476  proc sort data=MF_merged3_1a ; by permno rdate mgmt_cd descending LargeMF; run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1A.
NOTE: The data set WORK.MF_MERGED3_1A has 7118887 observations and 45 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           7.50 seconds
      cpu time            9.81 seconds
      

1477  
1478  * keep firm-quarter with at least 1 true large MF and 1 pseudo large MF;
1479  data MF_merged3_1a; set MF_merged3_1a;
1480      to_keep = max(LargeMF, Pseudo_LargeMF);
1481  run;

NOTE: There were 7118887 observations read from the data set WORK.MF_MERGED3_1A.
NOTE: The data set WORK.MF_MERGED3_1A has 7118887 observations and 46 variables.
NOTE: DATA statement used (Total process time):
      real time           2.87 seconds
      cpu time            2.79 seconds
      

1482  
1483  proc sql;
1484      create table to_keep as
1485      select permno, rdate, LargeMF, Pseudo_LargeMF, to_keep
1486      from MF_merged3_1a ;
NOTE: Table WORK.TO_KEEP created, with 7118887 rows and 5 columns.

1487  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.47 seconds
      cpu time            1.37 seconds
      

1488  proc sort data=to_keep nodupkey; by permno rdate descending LargeMF Pseudo_LargeMF; run;

NOTE: There were 7118887 observations read from the data set WORK.TO_KEEP.
NOTE: 6377232 observations with duplicate key values were deleted.
NOTE: The data set WORK.TO_KEEP has 741655 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.94 seconds
      cpu time            2.00 seconds
      

1489  
1490  proc sql;
1491      create table to_keep2 as
1492      select permno, rdate, sum(to_keep) as to_keep2
1493      from to_keep
1494      group by permno, rdate
1495      having sum(to_keep) >= 2;
NOTE: Table WORK.TO_KEEP2 created, with 206915 rows and 3 columns.

1496  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds
      

1497  * remove duplicates, each firm-quarter has only 1 observation;
1498  proc sort data=to_keep2 nodupkey; by permno rdate; run;

NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1499  
1500  proc sql;
1501      create table MF_merged3_1b as
1502      select a.*, b.to_keep2
1503      from MF_merged3_1a as a join to_keep2 as b
1504      on a.permno=b.permno and a.rdate=b.rdate;
NOTE: Table WORK.MF_MERGED3_1B created, with 6805872 rows and 47 columns.

1505  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           3.67 seconds
      cpu time            3.57 seconds
      

1506  
1507  
1508  * ============================================================================== ;
1509  *               PART 3: SELECT GROUP X - BASED ON AUM PERCENTILE
1510  *               TWO CASES: (1) ALTERNATIVE SMALL, (2) PSEUDO LARGE
1511  *               NOTE: YOU NEED TO DETERMINE THE AUM PERCENTILE IN PART 2
1512  * ============================================================================== ;
1513  
1514  *SELECT ONE CASE - AND COMMENT OUT THE OTHER CASE - in total, need to run the code 4 times
1514! ;
1515  
1516  
1517  /** ----------------------------------------------------------------------;*/
1518  /** CASE 1: use MFGroup X as pseudo-LargeMF that we compare with true SmallMF -> THIS IS
1518! PANEL A IN TABLE 10 ;*/
1519  /** ----------------------------------------------------------------------;*/
1520  /*data MF_merged3_1b; set MF_merged3_1b;*/
1521  /*  if LargeMF=1 then delete; */
1522  /*  drop LargeMF to_keep to_keep2;*/
1523  /*  rename Pseudo_LargeMF = LargeMF;*/
1524  /*  if Pseudo_LargeMF= . then Pseudo_LargeMF=0;*/
1525  /*  label Pseudo_LargeMF = "pseudo largeMF = 1";*/
1526  /*run;*/
1527  
1528  
1529  * ----------------------------------------------------------------------;
1530  * CASE 2: use MFGroup X as Alternative-SmallMF that we compare with true Large MF -> THIS
1530! IS PANEL B IN TABLE 10 ;
1531  * ----------------------------------------------------------------------;
1532  data MF_merged3_1b; set MF_merged3_1b;
1533      * keep only BH_LargeAUM and nonBH_LargeAUM -> drop if both are zero;
1534      if (BH_LargeAUM=0 & nonBH_LargeAUM=0) then delete;
1535      drop to_keep to_keep2  ;
1536  run;

NOTE: There were 6805872 observations read from the data set WORK.MF_MERGED3_1B.
NOTE: The data set WORK.MF_MERGED3_1B has 1322897 observations and 45 variables.
NOTE: DATA statement used (Total process time):
      real time           1.50 seconds
      cpu time            1.40 seconds
      

1537  
1538  
1539  * ============================================================================== ;
1540  *                                   PART 4:
1541  *                       MERGE GVKEY & RDQ FROM COMPUSTAT
1542  * ============================================================================== ;
1543  %let vars=  gvkey fyearq fqtr fyr rdq conm datadate indfmt datafmt popsrc consol saleq atq;
1544  
1545  data fundq;
1546     set comp.fundq_1950_2021 (keep= &vars);
1547     where datadate between "&begdate"d and "&enddate"d ;
1548     if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';
1549     format endfyr begfyr date9.;
1550     endfyr= datadate;
1551     begfyr= intnx('month',endfyr,-11,'beg');
1552  run;

NOTE: There were 1240531 observations read from the data set COMP.FUNDQ_1950_2021.
      WHERE (datadate>='01MAR1995'D and datadate<='31DEC2021'D);
NOTE: The data set WORK.FUNDQ has 1236959 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           4.09 seconds
      cpu time            0.51 seconds
      

1553  
1554  proc sort; by gvkey endfyr; run;

NOTE: There were 1236959 observations read from the data set WORK.FUNDQ.
NOTE: The data set WORK.FUNDQ has 1236959 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.41 seconds
      cpu time            0.54 seconds
      

1555  
1556  
1557  /* Make a link GVKEYS to CRSP-PERMNO; */
1558  proc sql;
1559    create table comp_lnk as select *
1560    from fundq as a, lnk.ccmxpf_lnkhist as b
1561    where a.gvkey = b.gvkey and
1562    b.LINKTYPE in ("LU","LC","LD","LN","LS","LX") and
1563    (b.LINKDT <= a.endfyr or b.LINKDT = .B) and (a.endfyr <= b.LINKENDDT or b.LINKENDDT = .E)
1563! ;
WARNING: Variable GVKEY already exists on file WORK.COMP_LNK.
NOTE: Table WORK.COMP_LNK created, with 808675 rows and 22 columns.

1564  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.24 seconds
      cpu time            0.20 seconds
      

1565  
1566  
1567  * ============================================================================== ;
1568  *                       PART 5: CREATE MAIN DEPVAR
1569  * ============================================================================== ;
1570  proc sql;
1571      create view MF_merged_comp1 as
1572      select a.gvkey, a.datadate, a.rdq, b.*
1573      from comp_lnk as a join MF_merged3_1b as b
1574      on a.lpermno=b.permno and
1575         year(a.datadate)=year(b.rdate) and qtr(a.datadate)=qtr(b.rdate);
NOTE: SQL view WORK.MF_MERGED_COMP1 has been defined.
1576  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1577  
1578  proc sort
1579      data=MF_merged_comp1
1580      out=MF_merged_comp nodupkey ;
1581      by permno rdate mgmt_cd ;
1582  run;

NOTE: There were 1348762 observations read from the data set WORK.MF_MERGED_COMP1.
NOTE: 29420 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP has 1319342 observations and 48 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           1.54 seconds
      cpu time            1.70 seconds
      

1583  
1584  
1585  * read the abnormal return data;
1586  data abret_car;
1587      set rawdata.abret013024_capm;
1588  run;

NOTE: There were 816855 observations read from the data set RAWDATA.ABRET013024_CAPM.
NOTE: The data set WORK.ABRET_CAR has 816855 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.19 seconds
      cpu time            0.01 seconds
      

1589  proc sort data=abret_car nodupkey; by gvkey rdq; run;

NOTE: There were 816855 observations read from the data set WORK.ABRET_CAR.
NOTE: 9675 observations with duplicate key values were deleted.
NOTE: The data set WORK.ABRET_CAR has 807180 observations and 9 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.11 seconds
      cpu time            0.26 seconds
      

1590  
1591  * lead abnormal returns by 1 quarter;
1592  proc expand data = abret_car out=abret_car method=none ;
1593      by gvkey ;
1594      id rdq;
1595      convert abret = abret_lead / transformout = (lead 1);
1596      convert car   = car_lead / transformout = (lead 1);
1597  run;

NOTE: The data set WORK.ABRET_CAR has 807180 observations and 11 variables.
NOTE: PROCEDURE EXPAND used (Total process time):
      real time           0.99 seconds
      cpu time            0.92 seconds
      

1598  
1599  data abret_car;
1600      set abret_car;
1601      label abret_lead="Abret t+1";
1602      label car_lead="CAR[-1+1] t+1";
1603  run;

NOTE: There were 807180 observations read from the data set WORK.ABRET_CAR.
NOTE: The data set WORK.ABRET_CAR has 807180 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds
      

1604  
1605  * merge Abnormal returns to MFF data;
1606  proc sql;
1607      create table MF_merged_comp as
1608      select a.*, b.car, b.abret, b.car_lead, b.abret_lead, b.logret, b.fyear
1609      from MF_merged_comp as a join abret_car as b
1610      on a.gvkey=b.gvkey and a.rdq=b.rdq;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP created, with 1295239 rows and 54 columns.

1611  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.91 seconds
      cpu time            0.90 seconds
      

1612  
1613  /* Winsorize variables  */
1614  %let winsVars2 = car_lead abret_lead changeMFOR changefweight   ;
1615  %winsor(dsetin=work.MF_merged_comp, dsetout=work.MF_merged_comp, byvar=fyear,
1615! vars=&winsVars2, type=winsor, pctl=1 99);

NOTE: There were 1295239 observations read from the data set WORK.MF_MERGED_COMP.
NOTE: The data set WORK.XTEMP has 1295239 observations and 54 variables.
NOTE: DATA statement used (Total process time):
      real time           0.58 seconds
      cpu time            0.54 seconds
      


NOTE: There were 1295239 observations read from the data set WORK.XTEMP.
NOTE: The data set WORK.XTEMP has 1295239 observations and 54 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           1.17 seconds
      cpu time            1.25 seconds
      


NOTE: The data set WORK.XTEMP_PCTL has 26 observations and 9 variables.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           2.11 seconds
      cpu time            2.07 seconds
      


WARNING: The variable xbyvar in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: There were 1295239 observations read from the data set WORK.XTEMP.
NOTE: There were 26 observations read from the data set WORK.XTEMP_PCTL.
NOTE: The data set WORK.MF_MERGED_COMP has 1295239 observations and 54 variables.
NOTE: DATA statement used (Total process time):
      real time           0.45 seconds
      cpu time            0.45 seconds
      

1616  proc sql;
1616!           drop table xtemp, xtemp_pctl;
NOTE: Table WORK.XTEMP has been dropped.
NOTE: Table WORK.XTEMP_PCTL has been dropped.
1616!                                         run;
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.
1617  
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds
      

1618  proc sort data = MF_merged_comp; by permno rdate LargeMF mgmt_cd; run;

NOTE: There were 1295239 observations read from the data set WORK.MF_MERGED_COMP.
NOTE: The data set WORK.MF_MERGED_COMP has 1295239 observations and 54 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           1.29 seconds
      cpu time            1.26 seconds
      

1619  
1620  data MF_merged_comp;
1621      set MF_merged_comp;
1622      format car abret car_lead abret_lead comma8.5;
1623      stkpick1 = (changeMFOR * 100)    * (car_lead * 100);
1624      stkpick2 = (changefweight * 100) * (car_lead * 100);
1625      stkpick3 = uphold*car_lead* 100 ;
1626  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      12728 at 1623:50   144 at 1624:31     12723 at 1624:50   12728 at 1625:22
NOTE: There were 1295239 observations read from the data set WORK.MF_MERGED_COMP.
NOTE: The data set WORK.MF_MERGED_COMP has 1295239 observations and 57 variables.
NOTE: DATA statement used (Total process time):
      real time           0.64 seconds
      cpu time            0.60 seconds
      

1627  
1628  
1629  
1630  *
1630! *******************************************************************************************
1630! **** ;
1631  proc sort data = MF_merged_comp; by permno rdate; run;

NOTE: There were 1295239 observations read from the data set WORK.MF_MERGED_COMP.
NOTE: The data set WORK.MF_MERGED_COMP has 1295239 observations and 57 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           1.11 seconds
      cpu time            1.32 seconds
      

1632  
1633  proc means data=MF_merged_comp noprint;
1634      where shares_adj>0 ;
1635      by permno rdate;
1636      var shares_adj;
1637      output out=MFO_Metrics_comp (drop=_freq_ _type_)
1638             n=NumOwners max(NumInst)=NumInst
1639             sum(shares_adj)=MFO_TOTAL
1640             USS(shares_adj)=MFO_SS;
1641  run;

NOTE: There were 1295239 observations read from the data set WORK.MF_MERGED_COMP.
      WHERE shares_adj>0;
NOTE: The data set WORK.MFO_METRICS_COMP has 200615 observations and 6 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.92 seconds
      cpu time            0.90 seconds
      

1642  
1643  * compute MFOC_HHI;
1644  data MFO_Metrics_comp;
1645      set MFO_Metrics_comp;
1646      by permno rdate;
1647      MFOC_HHI = MFO_SS/(MFO_TOTAL**2);
1648      label MFO_TOTAL  = "Sum of all shares, Total - Adjusted";
1649      label MFOC_HHI   = "MFO Concentration - Herfindahl- Hirschman Index";
1650      label MFO_SS     = "Sum of squares of shares adjusted";
1651      label NumOwners  = "Number of S12 Filers of a firm Each Quarter";
1652      label NumInst    = "Total Number of S12 Filers During Each Quarter";
1653  run;

NOTE: There were 200615 observations read from the data set WORK.MFO_METRICS_COMP.
NOTE: The data set WORK.MFO_METRICS_COMP has 200615 observations and 7 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds
      

1654  
1655  * Make a time series data, will merge to the final output late;
1656  data MFO_TimeSeries_comp;
1657      merge MFO_Metrics_comp(in=a) Price (in=b rename=(qdate=rdate));
1658      by permno rdate;
1659      if b and TSO>0;
1660      if a and MFO_TOTAL>0;
1661      MFOR = MFO_TOTAL/TSO;
1662      if missing(MFOR) then MFOR=0;
1663      MFO_MISSING = (not a);
1664      MFO_G1 = (MFOR>1);
1665      label MFOR = "Mutual Fund Ownership Ratio";
1666      label MFO_MISSING = "Missing (or NA) 13-F Data";
1667      label MFO_G1 = "MFOR % > 1";
1668      drop CFACSHR;
1669      format MFO_TOTAL NumOwners comma16. MFOR MFOC_HHI percentn8.2;
1670  run;

NOTE: There were 200615 observations read from the data set WORK.MFO_METRICS_COMP.
NOTE: There were 788968 observations read from the data set WORK.PRICE.
NOTE: The data set WORK.MFO_TIMESERIES_COMP has 200615 observations and 17 variables.
NOTE: DATA statement used (Total process time):
      real time           0.11 seconds
      cpu time            0.07 seconds
      

1671  
1672  
1673  *
1673! *******************************************************************************************
1673! **** ;
1674  
1675  proc sql;
1676      create table MF_merged_comp2 as
1677      select   *
1678               ,avg(stkpick1) as avg_stkpick1_all
1679               ,avg(stkpick2) as avg_stkpick2_all
1680               ,avg(stkpick3) as avg_stkpick3_all
1681      from     MF_merged_comp
1682      group by permno, rdate
1683      order by permno, rdate, LargeMF ;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.MF_MERGED_COMP2 created, with 1295239 rows and 60 columns.

1684  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.54 seconds
      cpu time            1.70 seconds
      

1685  
1686  proc sql;
1687      create table MF_merged_comp2_1 as
1688      select   gvkey, datadate, rdq, car_lead, car
1689               ,permno, rdate, md, qd, LargeMF, mgmt_cd, MFOR
1690               ,stkpick1
1691               ,stkpick2
1692               ,stkpick3
1693               ,avg_stkpick1_all
1694               ,avg_stkpick2_all
1695               ,avg_stkpick3_all
1696      from     MF_merged_comp2 ;
NOTE: Table WORK.MF_MERGED_COMP2_1 created, with 1295239 rows and 18 columns.

1697  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.40 seconds
      cpu time            0.37 seconds
      

1698  
1699  proc sql;
1700      create table MF_merged_comp2_2 as
1701      select   *
1702               ,avg(stkpick1) as avg_stkpick1
1703               ,avg(stkpick2) as avg_stkpick2
1704               ,avg(stkpick3) as avg_stkpick3
1705               ,count(mgmt_cd)  as NumInst
1706               ,avg(MFOR)     as avgMFOR
1707               ,sum(MFOR)     as sumMFOR
1708      from     MF_merged_comp2_1
1709      group by permno, rdate, LargeMF
1710      order by permno, rdate, LargeMF;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.MF_MERGED_COMP2_2 created, with 1295239 rows and 24 columns.

1711  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.42 seconds
      cpu time            0.40 seconds
      

1712  
1713  
1714  
1715  * ============================================================================== ;
1716  *                               PART 6:
1717  *                   COLLAPE DATA TO FIRM-QUARTER LEVEL
1718  * ============================================================================== ;
1719  
1720  data MF_merged_comp2_2; set MF_merged_comp2_2;
1721      if LargeMF=1 then _stkpick1_Large = avg_stkpick1;
1722      if LargeMF=0 then _stkpick1_Small = avg_stkpick1;
1723      if LargeMF=1 then _stkpick2_Large = avg_stkpick2;
1724      if LargeMF=0 then _stkpick2_Small = avg_stkpick2;
1725      if LargeMF=1 then _stkpick3_Large = avg_stkpick3;
1726      if LargeMF=0 then _stkpick3_Small = avg_stkpick3;
1727      drop mgmt_cd MFOR ;
1728  run;

NOTE: There were 1295239 observations read from the data set WORK.MF_MERGED_COMP2_2.
NOTE: The data set WORK.MF_MERGED_COMP2_2 has 1295239 observations and 28 variables.
NOTE: DATA statement used (Total process time):
      real time           0.29 seconds
      cpu time            0.29 seconds
      

1729  proc sort data=MF_merged_comp2_2 nodupkey; by permno rdate LargeMF; run;

NOTE: There were 1295239 observations read from the data set WORK.MF_MERGED_COMP2_2.
NOTE: 934089 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2_2 has 361150 observations and 28 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.47 seconds
      cpu time            0.51 seconds
      

1730  
1731  proc sql;
1732      create table MF_merged_comp2_3 as
1733      select *
1734             , max(_stkpick1_Large) as stkpick1_Large
1735             , max(_stkpick1_Small) as stkpick1_Small
1736             , max(_stkpick2_Large) as stkpick2_Large
1737             , max(_stkpick2_Small) as stkpick2_Small
1738             , max(_stkpick3_Large) as stkpick3_Large
1739             , max(_stkpick3_Small) as stkpick3_Small
1740      from  MF_merged_comp2_2
1741      group by permno, rdate
1742      order by permno, rdate, LargeMF;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.MF_MERGED_COMP2_3 created, with 361150 rows and 34 columns.

1743  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.23 seconds
      cpu time            0.29 seconds
      

1744  
1745  data MF_merged_comp2_3; set MF_merged_comp2_3;
1746      drop _stkpick1_Large _stkpick1_Small
1747           _stkpick2_Large _stkpick2_Small
1748           _stkpick3_Large _stkpick3_Small;
1749          year = year(rdate);
1750  run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 361150 observations and 29 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.06 seconds
      

1751  
1752  
1753  * treat outliers;
1754  %let winsVars = avg_stkpick1 avg_stkpick2 avg_stkpick1_all stkpick1_Large stkpick1_Small;
1755  %winsor(
1756      dsetin  = work.MF_merged_comp2_3,
1757      dsetout = work.MF_merged_comp2_3,
1758      byvar   = year,
1759      vars    = &winsVars,
1760      type    = winsor,
1761      pctl    = 1 99
1762  );

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: The data set WORK.XTEMP has 361150 observations and 29 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.07 seconds
      


NOTE: There were 361150 observations read from the data set WORK.XTEMP.
NOTE: The data set WORK.XTEMP has 361150 observations and 29 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.24 seconds
      cpu time            0.23 seconds
      


NOTE: The data set WORK.XTEMP_PCTL has 25 observations and 11 variables.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           0.61 seconds
      cpu time            0.57 seconds
      


WARNING: The variable xbyvar in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: There were 361150 observations read from the data set WORK.XTEMP.
NOTE: There were 25 observations read from the data set WORK.XTEMP_PCTL.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 361150 observations and 29 variables.
NOTE: DATA statement used (Total process time):
      real time           0.15 seconds
      cpu time            0.14 seconds
      

1763  proc sql;
1764      drop table xtemp, xtemp_pctl;
NOTE: Table WORK.XTEMP has been dropped.
NOTE: Table WORK.XTEMP_PCTL has been dropped.
1765  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1766  
1767  
1768  * we compute the difference between LargeMF(=1) and smallMF (=0);
1769  proc sort data=MF_merged_comp2_3 nodupkey; by permno rdate LargeMF ; run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 361150 observations and 29 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.11 seconds
      cpu time            0.18 seconds
      

1770  data MF_merged_comp2_3;
1771      set MF_merged_comp2_3;
1772      by permno rdate;
1773      Relstkpick1 = dif(avg_stkpick1);
1774      if first.permno or first.rdate then Relstkpick1 = .;
1775  run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 361150 observations and 30 variables.
NOTE: DATA statement used (Total process time):
      real time           0.11 seconds
      cpu time            0.11 seconds
      

1776  
1777  proc sort data=MF_merged_comp2_3 nodupkey; by permno rdate LargeMF ; run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2_3 has 361150 observations and 30 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.21 seconds
      cpu time            0.23 seconds
      

1778  data MF_merged_comp2_4;
1779      set MF_merged_comp2_3;
1780      by permno rdate;
1781      Relstkpick2 = dif(avg_stkpick2);
1782      if first.permno or first.rdate then Relstkpick2 = .;
1783  run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_3.
NOTE: The data set WORK.MF_MERGED_COMP2_4 has 361150 observations and 31 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.06 seconds
      

1784  
1785  proc sort data=MF_merged_comp2_4 ; by permno rdate  LargeMF ; run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_4.
NOTE: The data set WORK.MF_MERGED_COMP2_4 has 361150 observations and 31 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.23 seconds
      cpu time            0.25 seconds
      

1786  data MF_merged_comp2_5;
1787      set MF_merged_comp2_4;
1788      by permno rdate;
1789      Relstkpick3 = dif(avg_stkpick3);
1790      if first.permno or first.rdate then Relstkpick3 = .;
1791  run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_4.
NOTE: The data set WORK.MF_MERGED_COMP2_5 has 361150 observations and 32 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.06 seconds
      

1792  
1793  proc sort data=MF_merged_comp2_5 ; by permno rdate  LargeMF ; run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_5.
NOTE: The data set WORK.MF_MERGED_COMP2_5 has 361150 observations and 32 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.20 seconds
      cpu time            0.21 seconds
      

1794  data MF_merged_comp2_6; set MF_merged_comp2_5;
1795      if LargeMF = 0 then _avgMFORsmall = avgMFOR; else _avgMFORsmall = 0 ;
1796      if LargeMF = 1 then _avgMFORlarge = avgMFOR; else _avgMFORlarge = 0 ;
1797      if LargeMF = 0 then _sumMFORsmall = sumMFOR; else _sumMFORsmall = 0 ;
1798      if LargeMF = 1 then _sumMFORlarge = sumMFOR; else _sumMFORlarge = 0 ;
1799      if LargeMF = 0 then _NumInstsmall = NumInst; else _NumInstsmall = 0 ;
1800      if LargeMF = 1 then _NumInstlarge = NumInst; else _NumInstlarge = 0 ;
1801  run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_5.
NOTE: The data set WORK.MF_MERGED_COMP2_6 has 361150 observations and 38 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.09 seconds
      

1802  * collapse data to the firm-quarter;
1803  proc sql;
1804      create table MF_merged_comp2_6 as
1805      select  *,
1806              max(_avgMFORsmall) as avgMFORsmall,
1807              max(_avgMFORlarge) as avgMFORlarge,
1808              max(_sumMFORsmall) as sumMFORsmall,
1809              max(_sumMFORlarge) as sumMFORlarge,
1810              max(_NumInstsmall) as NumInstsmall,
1811              max(_NumInstlarge) as NumInstlarge
1812      from    MF_merged_comp2_6
1813      group by permno, rdate ;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP2_6 created, with 361150 rows and 44 columns.

1814  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.41 seconds
      cpu time            0.42 seconds
      

1815  
1816  data MF_merged_comp3; set MF_merged_comp2_6;
1817      drop    LargeMF avg_stkpick1 avg_stkpick2 avg_stkpick3;
1818      if      Relstkpick2 eq . then delete;
1819      ryear   = year(rdate);
1820      format  avgMFORsmall avgMFORlarge sumMFORsmall sumMFORlarge percent8.2;
1821      drop    _avgMFORsmall _avgMFORlarge _sumMFORsmall _sumMFORlarge _NumInstsmall
1821! _NumInstlarge NumInst avgMFOR sumMFOR ;
1822  run;

NOTE: There were 361150 observations read from the data set WORK.MF_MERGED_COMP2_6.
NOTE: The data set WORK.MF_MERGED_COMP3 has 158618 observations and 32 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.07 seconds
      

1823  proc sort data=MF_merged_comp3 nodupkey; by permno rdate; run;

NOTE: There were 158618 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP3 has 158618 observations and 32 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.11 seconds
      cpu time            0.12 seconds
      

1824  
1825  proc sort data=MF_merged_comp3; by permno qd md; run;

NOTE: There were 158618 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: The data set WORK.MF_MERGED_COMP3 has 158618 observations and 32 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.09 seconds
      cpu time            0.11 seconds
      

1826  data MF_merged_comp4;
1827      retain gvkey datadate rdq permno rdate ryear;
1828      set MF_merged_comp3;
1829      by  permno qd md;
1830      if  last.qd;
1831  run;

NOTE: There were 158618 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: The data set WORK.MF_MERGED_COMP4 has 158618 observations and 32 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
      

1832  
1833  * Get MFOR, MFO_HHI, and Number of MFs;
1834  proc sql;
1835      create table MF_merged_comp4 as
1836      select  a.*,
1837              b.NumOwners,
1838              b.MFOR,
1839              b.MFOC_HHI,
1840              b.me
1841      from    MF_merged_comp4 as a left join MFO_TimeSeries_comp as b
1842      on      a.permno=b.permno and a.rdate=b.rdate
1843      order   by a.permno, a.rdate;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP4 created, with 158618 rows and 36 columns.

1844  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.44 seconds
      cpu time            0.28 seconds
      

1845  
1846  data MF_merged_comp4; set MF_merged_comp4;
1847      label   avg_stkpick1_all="StockPick All"
1848              stkpick1_Large="StockPick Large"
1849              stkpick1_Small="StockPick Small"
1850              Relstkpick1="Relative StockPick"
1851              Relstkpick2="Relative StockPick2" ;
1852  run;

NOTE: There were 158618 observations read from the data set WORK.MF_MERGED_COMP4.
NOTE: The data set WORK.MF_MERGED_COMP4 has 158618 observations and 36 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.04 seconds
      

1853  
1854  
1855  * ============================================================================== ;
1856  *                           PART 7:
1857  *                       EXPORT FINAL DATA
1858  * ============================================================================== ;
1859  
1860  * Must run the code 4 times for different selection;
1861  
1862  data finaldat; set MF_merged_comp4; run;

NOTE: There were 158618 observations read from the data set WORK.MF_MERGED_COMP4.
NOTE: The data set WORK.FINALDAT has 158618 observations and 36 variables.
NOTE: DATA statement used (Total process time):
      real time           0.13 seconds
      cpu time            0.03 seconds
      

1863  
1864  * update the following selections to generate different dataset :
1865  * (1) PART 1: CALCULATE AUM PERCENTILES: 90, 95
1866  * (2) PART 2: SELECT THE THRESHOLD: 90, 95
1867  * (3) PART 3: SELECT PSEUDO-LARGE (CASE 1) OR PSEUDO-SMALL (CASE 2) ;
1868  
1869  * ------------------------------------------------------------------------------;
1870  * We use 4 specifications: _p90a, _p95a, and _p90b, _p95b in our paper
1871  * ------------------------------------------------------------------------------;
1872  
1873  *** PANEL A of TABLE 10;
1874  /*data save.stkpick020425_aum_p90_1; set finaldat; run; */
1875  /*data save.stkpick020425_aum_p95_1; set finaldat; run;*/
1876  
1877  *** PANEL B of TABLE 10;
1878  /*data save.stkpick020525_aum_p90_2; set finaldat; run; */
1879  data save.stkpick020525_aum_p95_2; set finaldat; run;

NOTE: There were 158618 observations read from the data set WORK.FINALDAT.
NOTE: The data set SAVE.STKPICK020525_AUM_P95_2 has 158618 observations and 36 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.04 seconds
      

1880  
1881  
1882  
1883  ** House cleaning;
1884  proc datasets nowarn nolist nodetails;
1885      delete MF_merged_comp MF_merged_comp1 MF_merged_comp2 MF_merged_comp3 abret_car
1885! MFO_Metrics_comp MFO_TimeSeries_comp Holdings2 Mf_holdings
1886      First_vint Equity_funds Mf_port Fundchars Fund_style Returns_merged Names Price Returns
1886!  Fundq Comp_lnk  Std_mgmt_names _stats_mfor To_keep To_keep2
1887      _metrics_ijt _stats_aum  _stats_mfor _stats_n _stats_ aum_it aum_ijt  mf_tmp
1887! _stats_ijt_1_  _stats_ijt_2_;
1888  run;

NOTE: Deleting WORK.MF_MERGED_COMP (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP3 (memtype=DATA).
NOTE: Deleting WORK.ABRET_CAR (memtype=DATA).
NOTE: Deleting WORK.MFO_METRICS_COMP (memtype=DATA).
NOTE: Deleting WORK.MFO_TIMESERIES_COMP (memtype=DATA).
NOTE: Deleting WORK.HOLDINGS2 (memtype=DATA).
NOTE: Deleting WORK.MF_HOLDINGS (memtype=DATA).
NOTE: Deleting WORK.FIRST_VINT (memtype=DATA).
NOTE: Deleting WORK.EQUITY_FUNDS (memtype=DATA).
NOTE: Deleting WORK.MF_PORT (memtype=DATA).
NOTE: Deleting WORK.FUNDCHARS (memtype=DATA).
NOTE: Deleting WORK.FUND_STYLE (memtype=DATA).
NOTE: Deleting WORK.RETURNS_MERGED (memtype=DATA).
NOTE: Deleting WORK.NAMES (memtype=DATA).
NOTE: Deleting WORK.PRICE (memtype=DATA).
NOTE: Deleting WORK.RETURNS (memtype=DATA).
NOTE: Deleting WORK.FUNDQ (memtype=DATA).
NOTE: Deleting WORK.COMP_LNK (memtype=DATA).
NOTE: Deleting WORK.STD_MGMT_NAMES (memtype=DATA).
NOTE: Deleting WORK.TO_KEEP (memtype=DATA).
NOTE: Deleting WORK.TO_KEEP2 (memtype=DATA).
NOTE: Deleting WORK._STATS_ (memtype=DATA).
NOTE: Deleting WORK.AUM_IJT (memtype=DATA).
NOTE: Deleting WORK._STATS_IJT_1_ (memtype=DATA).
NOTE: Deleting WORK._STATS_IJT_2_ (memtype=DATA).
1888!      quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.91 seconds
      cpu time            0.84 seconds
      

1889  proc datasets nowarn nolist nodetails;
1890      delete MF_merged:   ;
1891  run;

NOTE: Deleting WORK.MF_MERGED (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED3 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED3_1 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED3_1A (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED3_1B (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2_1 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2_2 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2_3 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2_4 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2_5 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2_6 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP4 (memtype=DATA).
1891!      quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           1.18 seconds
      cpu time            1.14 seconds
      

1892  proc datasets nowarn nolist nodetails;
1893      delete Funds:   ;
1894  run;

NOTE: Deleting WORK.FUNDS3 (memtype=DATA).
NOTE: Deleting WORK.FUNDS4 (memtype=DATA).
NOTE: Deleting WORK.FUNDS5 (memtype=DATA).
1894!      quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1895  proc datasets nowarn nolist nodetails;
1896      delete Funds:   ;
1897  run;

1897!      quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1898  proc sql;
1899      drop view Mf_merged_comp1;
NOTE: View WORK.MF_MERGED_COMP1 has been dropped.
1900  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1901  
1902  
1903  
1904  proc printto;
1905  run;

